package jk.zmn.socket.tcp.demo3;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * @author 张梦楠
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2018/5/3119:01
 * @blog www.itzmn.com
 */
public class ClientDemo3 {
    public static void main(String[] args) throws Exception{

        Socket socket = new Socket("localhost", 8888);

        System.out.println("请输入名称：");
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String name = bufferedReader.readLine();//得到名称
      /*  BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        DataOutputStream dataOutputStream = new DataOutputStream(socket.getOutputStream());
        dataOutputStream.writeUTF(bufferedReader.readLine());
        dataOutputStream.flush();*/
       new Thread(new Send(socket,name)).start();

       new Thread(new Recive(socket)).start();

    }

}
